﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
namespace FTchina.SiteConfig
{

    /// <summary>
    ///SiteConfig 的摘要说明
    /// </summary>
    public class SiteInfo
    {
        private SiteConfig.XmlConfig xcf;
        public SiteInfo()
        {
            //
            //TODO: 在此处添加构造函数逻辑
            //
            xcf = new XmlConfig(basic.GetMapPath() + "/site.config");


        }
        /// <summary>
        /// 缓存时间,单位秒
        /// </summary>
        public string CacheTime
        {
            get { return xcf.ReadConfig("Basic", "CacheTime"); }
            set { xcf.WriteConfig("Basic", "CacheTime", value); }
        }
        /// <summary>
        /// 网站访问地址
        /// </summary>
        public string SiteUrl
        {
            get { return xcf.ReadConfig("Basic", "SiteUrl"); }
            set { xcf.WriteConfig("Basic", "SiteUrl", value); }
        }
        /// <summary>
        /// /Index.aspx跳转地址
        /// </summary>
        public string IndexRedirect
        {
            get { return xcf.ReadConfig("Basic", "IndexRedirect"); }
            set { xcf.WriteConfig("Basic", "IndexRedirect", value); }
        }
        /// <summary>
        /// 网站名称
        /// </summary>
        public string SiteName
        {
            get { return xcf.ReadConfig("Basic", "SiteName"); }
            set { xcf.WriteConfig("Basic", "SiteName", value); }
        }
        /// <summary>
        /// 是否生成静态文件 True:后缀为aspx的html;False:不生成静态文件
        /// </summary>
        public Boolean IsHtml
        {
            get { return Convert.ToBoolean(xcf.ReadConfig("Basic", "IsHtml")); }
            set { xcf.WriteConfig("Basic", "IsHtml", value.ToString()); }
        }

        /// <summary>
        /// 菜单栏目的前导航
        /// </summary>
        public string QianDaohang
        {
            get { return xcf.ReadConfig("Basic", "QianDaohang"); }
            set { xcf.WriteConfig("Basic", "QianDaohang", value); }
        }
        /// <summary>
        /// 菜单栏目的后导航
        /// </summary>
        public string HouDaohang
        {
            get { return xcf.ReadConfig("Basic", "HouDaohang"); }
            set { xcf.WriteConfig("Basic", "HouDaohang", value); }
        }
        /// <summary>
        /// 网站Logo
        /// </summary>
        public string SiteLogo
        {
            get { return xcf.ReadConfig("Basic", "SiteLogo"); }
            set { xcf.WriteConfig("Basic", "SiteLogo", value); }
        }
        /// <summary>
        /// 网站Banner
        /// </summary>
        public string SiteBanner
        {
            get { return xcf.ReadConfig("Basic", "SiteBanner"); }
            set { xcf.WriteConfig("Basic", "SiteBanner", value); }
        }
        /// <summary>
        /// 用户自定义Meta
        /// </summary>
        public string UserMeta
        {
            get { return xcf.ReadConfig("Basic", "UserMeta"); }
            set { xcf.WriteConfig("Basic", "UserMeta", value); }
        }

        /// <summary>
        /// 网站底部链接
        /// </summary>
        public string SiteBottom
        {
            get { return xcf.ReadConfig("Basic", "SiteBottom"); }
            set { xcf.WriteConfig("Basic", "SiteBottom", value); }
        }

        /// <summary>
        /// 首页、分类页面过期时间，单位分钟
        /// </summary>
        public string RefreshTime
        {
            get { return xcf.ReadConfig("Basic", "RefreshTime"); }
            set { xcf.WriteConfig("Basic", "RefreshTime", value); }
        }


        /// <summary>
        /// 统计功能
        /// </summary>
        public Boolean Counter
        {
            get { return Convert.ToBoolean(xcf.ReadConfig("Basic", "Counter")); }
            set { xcf.WriteConfig("Basic", "Counter", value.ToString()); }
        }


        
    }
}